T
Chili.Opf3 Send comments on this topic.
Generic GetObjectList(Generic IList,String,Object[]) Method
See Also  Example
Chili.Opf3 Namespace > ObjectContext Class > GetObjectList Method : Generic GetObjectList(Generic IList,String,Object[]) Method




list
An instance of a class that implements the IList interface.
conditions
A condition string that specifies the objects that are loaded.
parameter
A list of parameter that is passed as parameter for the conditions.
Fills an instance of a class that implements the IList interface with objects.

Syntax

Visual Basic (Declaration) 
Overloads Public Overridable Function GetObjectList(Of T)( _
   ByVal list As IList(Of T), _
   ByVal conditions As String, _
   ByVal ParamArray parameter() As Object _
) As IList(Of T)
Visual Basic (Usage)Copy Code
Dim instance As ObjectContext
Dim list As IList(Of T)
Dim conditions As String
Dim parameter() As Object
Dim value As IList(Of T)
 
value = instance.GetObjectList(Of T)(list, conditions, parameter)
C# 
public virtual IList<T> GetObjectList<T>( 
   IList<T> list,
   string conditions,
   params object[] parameter
)
Managed Extensions for C++ 
public: virtual IList<T>* GetObjectList<T>( 
   IList<T>* list,
   string* conditions,
   params Object*[]* parameter
) 
C++/CLI 
public:
virtual IList<T>^ GetObjectListgeneric<typename T>
( 
   IList<T>^ list,
   String^ conditions,
   ... array<Object^>^ parameter
) 

Parameters

list
An instance of a class that implements the IList interface.
conditions
A condition string that specifies the objects that are loaded.
parameter
A list of parameter that is passed as parameter for the conditions.

Type Parameters

T

Return Value

The instance of a class that implements the IList interface.

Example

The following example introduces to the use of the GetObjectList routine.
C#Copy Code
// Creates a new ObjectContext that uses an MsSql Server as storage. 
ObjectContext context = new ObjectContext(new MsSqlStorage("sa", "",  
    "localhost", "application")); 
  
// ... Other code. 
  
// Gets all object matching the name and sorting them by name. 
IList<User%gt; userList = null; 
userList = context.GetObjectReader<User>(new List<User>(),  
    "Name like {0} SortBy Name Asc", "%mith%"); 
  
// Loop through all items and do something. 
foreach(User user in userList) 

    // Do something. 

    

Remarks

Returns a filled list of objects. All kind of lists that implement the IList interface are allowed.

Requirements

Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family

See Also